function  [c1_pl,c2_pl,c3_pl,c1_pw,c2_pw,c3_pw,c1_sl,c2_sl,c3_sl,c1_sw,c2_sw,c3_sw,k,cluster] =distance(cl1_pl,cl2_pl,cl3_pl,cl1_pw,cl2_pw,cl3_pw,cl1_sl,cl2_sl,cl3_sl,cl1_sw,cl2_sw,cl3_sw,k,plength,pwidth,slength,swidth)
for i=1:150
    cl1 = sqrt((str2double(plength{i,1})-cl1_pl)^2+(str2double(pwidth{i,1})-cl1_pw)^2+(str2double(slength{i,1})-cl1_sl)^2+(str2double(swidth{i,1})-cl1_sw)^2);
    cl2 = sqrt((str2double(plength{i,1})-cl2_pl)^2+(str2double(pwidth{i,1})-cl2_pw)^2+(str2double(slength{i,1})-cl2_sl)^2+(str2double(swidth{i,1})-cl2_sw)^2);
    cl3 = sqrt((str2double(plength{i,1})-cl3_pl)^2+(str2double(pwidth{i,1})-cl3_pw)^2+(str2double(slength{i,1})-cl3_sl)^2+(str2double(swidth{i,1})-cl3_sw)^2);
  
     minimum = mini(cl1,cl2,cl3);
   
   if strcmp(minimum,'cl1')
    cluster(k,i)=cellstr('1');
   elseif strcmp(minimum,'cl2')
       cluster(k,i) = cellstr('2');
   else
       cluster(k,i)= cellstr('3');
   end
end

   [c1_pl,c2_pl,c3_pl,c1_pw,c2_pw,c3_pw,c1_sl,c2_sl,c3_sl,c1_sw,c2_sw,c3_sw] = men(k,cluster,plength,pwidth,slength,swidth);
